package com.self.task;

import java.util.Random;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.LockSupport;

public class ThreadMain {


    public static void main(String[] args) {


        int epoch = 1;
        while (true) {

            try {

                get(epoch++);

            } catch (Exception e) {
                e.printStackTrace();
            }


            //LockSupport.parkNanos(TimeUnit.SECONDS.toNanos(2));
        }
    }

    private static ThPool get(int epoch) {

        ThPool thPool = new ThPool();
        thPool.loopTask(LogStackUtil::logStack,1L,1L);
        LockSupport.parkNanos(TimeUnit.MILLISECONDS.toNanos(100));
        throw new RuntimeException();
//        return thPool;
    }
}
